﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace automat_gpw
{
    public class CompanyValue : ICompanyValue
    {
        #region Private Members
        
        /// <summary>
        /// Cena otwarcia
        /// </summary>
        private decimal priceOpen;

        /// <summary>
        /// Cena zamknięcia
        /// </summary>
        private decimal priceClose;

        /// <summary>
        /// Najwyższa cena
        /// </summary>
        private decimal priceHighest;

        /// <summary>
        /// Najniższa cena
        /// </summary>
        private decimal priceLowest;

        /// <summary>
        /// Volume
        /// </summary>
        private int volume;

        /// <summary>
        /// Data
        /// </summary>
        private DateTime date;

        #endregion

        #region Implement Interface ICompanyValue
        
        public decimal PriceOpen
        {
            get
            {
                return this.priceOpen;
            }
            set
            {
                this.priceOpen = value;
            }
        }

        public decimal PriceClose
        {
            get
            {
                return this.priceClose;
            }
            set
            {
                this.priceClose = value;
            }
        }

        public decimal PriceHighest
        {
            get
            {
                return this.priceHighest;
            }
            set
            {
                this.priceHighest = value;
            }
        }

        public decimal PriceLowest
        {
            get
            {
                return this.priceLowest;
            }
            set
            {
                this.priceLowest = value;
            }
        }

        public int Volume
        {
            get
            {
                return this.volume;
            }
            set
            {
                this.volume = value;
            }
        }

        public DateTime Date
        {
            get
            {
                return this.date;
            }
            set
            {
                this.date = value;
            }
        }

        #endregion

       #region Contructors

        /// <summary>
        /// konstruktor bez parametrów
        /// </summary>
        public CompanyValue(){}

        /// <summary>
        /// Konstruktor kopiujący
        /// </summary>
        /// <param name="value">wartość inicjalizująca</param>
        public CompanyValue(ICompanyValue value)
        {
            this.Date = value.Date;
            this.PriceClose = value.PriceClose;
            this.PriceHighest = value.PriceHighest;
            this.PriceLowest = value.PriceLowest;
            this.PriceOpen = value.PriceOpen;
            this.Volume = value.Volume;
        }
        #endregion
    }
}
